package easycloud.ecs.common.domain;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.MappedSuperclass;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import org.springframework.data.jpa.domain.AbstractPersistable;

@SuppressWarnings("serial")
@MappedSuperclass
public abstract class AbstractSync extends AbstractPersistable<Integer> {

	@ManyToOne(fetch = FetchType.EAGER)
	@JoinColumn(name = "folderid")
	private Folder folder;

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "providerid")
	private Provider provider;

	@Column(name = "path", nullable = false)
	private String path;

	@Column(name = "createTime", nullable = false)
	@Temporal(TemporalType.TIMESTAMP)
	private Date createTime;

	public Date getCreateTime() {
		return createTime;
	}

	public Folder getFolder() {
		return folder;
	}

	public String getPath() {
		return path;
	}

	public Provider getProvider() {
		return provider;
	}

	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}

	public void setFolder(Folder folder) {
		this.folder = folder;
	}

	public void setPath(String path) {
		this.path = path;
	}

	public void setProvider(Provider provider) {
		this.provider = provider;
	}
}
